package com.online.service;

import com.online.dao.BlankMapper;
import com.online.entity.Blank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlankServiceImpl implements BlankService {

    @Autowired
    BlankMapper blankMapper;

    @Override
    public List<Blank> showBlankByKnowledge(String knowledge) {
        return blankMapper.selectBlankByKnowledge(knowledge);
    }

    @Override
    public Blank showBlankById(Integer blankId) {
        return blankMapper.selectBlankById(blankId);
    }

    @Override
    public int addQuestion(Blank blank) {
        return blankMapper.addBlank(blank);
    }

    @Override
    public List<Blank> showKnoFoBlank() {
        return blankMapper.selectBlankKno();
    }

    @Override
    public List<Blank> showBlanksRandom(String blanksKnowledge, int blanksNumber) {
        return blankMapper.selectRandom(blanksKnowledge,blanksNumber);
    }

    @Override
    public List<Blank> showBlank() {
        return blankMapper.selectBlank();
    }

    @Override
    public int deleteABlank(Integer blankId) {
        return blankMapper.deleteBlank(blankId);
    }
}
